package com.vehiclemanagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vehiclemanagement.entity.Driver;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 驾驶员Mapper接口
 */
@Mapper
public interface DriverMapper extends BaseMapper<Driver> {
    
    /**
     * 带条件的分页查询
     * 
     * @param page 分页对象
     * @param whereSql 条件SQL
     * @return 分页数据
     */
    @Select("SELECT * FROM driver WHERE ${whereSql}")
    IPage<Driver> selectPageWithDeleted(Page<Driver> page, @Param("whereSql") String whereSql);
    
    /**
     * 物理删除驾驶员记录
     * 
     * @param id 驾驶员ID
     * @return 影响行数
     */
    @Delete("DELETE FROM driver WHERE id = #{id}")
    int deletePhysically(@Param("id") Long id);
} 